package serialize;

import java.io.File;
import java.io.IOException;
import java.util.Calendar;
import java.util.Date;

/**
 * 测试 自定义的序列化 ( 肯定是有缺陷的 )
 */
public class SerializationTest1 {

	public static void main(String[] args) throws IOException {
		
		Calendar calendar = Calendar.getInstance();
		calendar.clear();// 清除所有日历字段的值
		calendar.set( 1998 , 9 , 25 , 12, 30 );
		Date birthdate = calendar.getTime() ;
		
		Person p = new Person( 9527 , "华安" , '男' , birthdate );
		
		PersonDao pd = new PersonDao();

		File f = new File( "student.dat" );
		
		pd.write( p , f );

	}

}
